Alibabacloud.com offers a wide variety of articles about learning angularjs guide to angularjs development, easily find your learning angularjs guide to angularjs development information here online.
Instruction Practice Development Guide in AngularJS (1), angularjs Guide
Directive is the most important part of all AngularJS applications. Although AngularJS already provides a rich s
remote serverThis feature helps you to request data or send data to the server. The service that implements the feature is the $http and $resource .
Modular ManagementThis feature helps you with modular programming for large, complex web applications. Of course, simple ANGULARJS applications should also be managed using modular programming, which is a good habit. To achieve this function angular.module , Angular.module can be said to be the basis
is much better than imperative code when building a view (UI) While writing software logic, although imperative code is well-suited to express business logic.
It is a very good idea to decouple DOM operation and application logic, which can greatly improve the regulation of code.
It is a very good idea to treat testing and development equally, and the difficulty of testing depends to a great extent on the structure of the Code;
Decou
the DOM after the browser is loaded and rendered, and in Angularjs, based on the template, controller, and model information.In Angularjs's implementation of MVC, the view is known to model and controller. The view knows the two-way binding of the model, and the view knows by instruction that the controller, such as ngController and ngView instructions, can also be known through bindings, such as {{someControllerFunction()}} . In these ways, the view
trigger an exception. Because usually we are waiting for the server to respond, and the variables are immediately defined and assigned. If an expression cannot tolerate undefined values, then the code we bind will have to be written as:{{((a||{}).b||{}).c}}Angular also returns undefined when executing an undefined function a.b.c()是, , without triggering an exception.No process Control structureYou cannot use a control structure in an expression. The reason for this design is that one of the ANG
the view. This implementation allows you to concentrate on your model. The view is always the projection of the model, and when the model changes, the view reflects that change, and vice versa.How most template systems are bound. They combine models and templates to generate views that are not dynamically updated by the combined process. To make things worse, the interaction between the user and the view is not reflected in the model. This means that the developer will automatically write the v
'];somemodule.factory (' greeter ', greeterfactory);In this case, we recommend using the third method:function (Renamed$window) { ...;}]);Dependency injection is common in angularjs and is commonly used in controller and factory methods.Dependency Injection in the controller:A controller is a class that is responsible for applying behavior. The recommended controller declaration methods are as follows:var function (DEP1, DEP2) { = [' Dep1 ', ' Dep2
, uppercase) {varout = ""; for(vari = 0; i ) { out= Input.charat (i) +Out ; } //conditional based on optional argument if(uppercase) {out=out.touppercase (); } returnOut ; } });functionCtrl ($scope) {$scope. Greeting= ' Hello ';}Filters can be used in any API or NG. $rootScoe. Scope is executed, but is typically used to format expressions that are bound to the template.{{ expression | filter }}Filters typically transform data into new formats during processing. It can use a chai
This article mainly introduces the instructions in AngularJS (2). For more information, see instructions in AngularJS (1, how to isolate the scope of an instruction. The second part will continue with the previous article. First, we will see how to access the attributes of the parent scope from inside the instruction while using the isolated scope. Next, we will discuss how to select the correct scope for t
, the instruction executes the relevant expression and updates the view using the $apply method.
When an external event (such as a user action, timer, or XHR) is triggered, the corresponding expression must be called within the $apply () method for its corresponding scope so that all listeners are correctly updated.The directives that will create scopesIn most cases, directives and scopes interact but do not produce new scope instances. However, some directives, such as ng-controller and ng
contaminated. In our HelloWorld instruction example, if we set scope to {}, the above code will not work. It creates a new quarantine scope, the corresponding expression {{color}} will point to this new scope, and its value will be undefined. Using the scope of isolation does not mean that we cannot access the properties of the parent scope at all. There are some techniques that allow us to access the properties of the parent scope and even monitor their changes. We will discuss these technique
CoreStart execution1 Use $apply() to enter the Angularjs execution context from the normal JavaScript context. In most cases (e.g., in the controller, the service), $apply have been used to handle the execution of the corresponding instruction for the current event. You only need to execute your own if you use a custom event callback or a callback that uses a third-party class library$apply scope.$apply(stimulusFn), the STIMULUSFN here is the functio
compilation function. This allows the following resources to be used.
Normalized property name: Because the name of the directive, such as ngbind , can be represented in many variants, such as ng:bind , or x-ng-bind , which makes it possible to obtain the corresponding property with a standard name.
Inter-Directive communication: All instructions share an instance of the same Property object, which allows the instruction to communicate through this Property object.
Su
The instruction Practice Guide in Angularjs (i) describes how to isolate the scope of an instruction. The second part will undertake the last article to continue to introduce. First, we will see how to access the properties of the parent scope from within the directive, using the isolation scope. Next, we will discuss how to choose the correct scope for the instruction based on the controller function and t
AngularJS self-learning path -- first understanding AngularJS and data binding, first understanding angularjsWhat is AngularJS?
AngularJS official documentation introduces it in this way. Client technologies fully written in JavaScript. It works with other long-history Web t
Use AngularJS to compile a more elegant JavaScript code guide, angularjs
Download the sample code in this article: modulePattern.zip-all four HTML files and panacea. js-1.6 KB
Introduction
AngularJS library contains many things, but I only want to focus on small ones in this article. I believe they can provide a better
Angularjs development FAQ-2 (angularjs built-in filter), angularjs-2
Several Commonly Used filters are built in angular to simplify our operations.
The filter uses the '|' symbol, which is similar to the pipeline in linux.
1. filter)
Filter can filter data based on conditions, for example:
{{[{name:'coolcao',age:23},{
Expression of AngularJS basic learning notes: angularjs learning notes
AngularJS binds data to HTML through expressions.
AngularJS expression
AngularJS expressions are written in double
Instructions for AngularJS basic learning notes and angularjs learning notes
AngularJS extends HTML attributes by using commands.
AngularJS commandsAngularJS commands are extended HTML attributes with a ng-prefix.
The ng-app comma
This article may not be updated regularly, the main record of this period of time in the ANGULARJS learning to develop some of the problems of the solution. This article to excerpt mainly, the main purpose or the confusion of their own in various places to find the solution of the summary, to leave a memo for themselves.1, novice in the initial use of Angularjs r
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.